package com.xdtech.play.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.play.model.PlayMember;
import com.xdtech.web.freemark.item.GridColumn;

public class PlayerItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private Long memberId;
	@GridColumn(title="玩家名称",width=200)
	private String memberName;
	@GridColumn(title="下注金额",width=200)
	private Integer playMoney;
	public Long getMemberId() {
		return memberId;
	}
	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}
	public String getMemberName() {
		return memberName;
	}
	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}
	public Integer getPlayMoney() {
		return playMoney;
	}
	public void setPlayMoney(Integer playMoney) {
		this.playMoney = playMoney;
	}
	
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static PlayerItem createItem(PlayMember playMember) {
		PlayerItem playMemberItem = null;
		if(playMember!=null) {
			playMemberItem = new PlayerItem();
			playMemberItem.setMemberId(playMember.getId());
			playMemberItem.setMemberName(playMember.getName());
			//自定义属性设置填充
		}
		
		return playMemberItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<PlayerItem> createItems(List<PlayMember> playMembers) {
		List<PlayerItem> playMemberItems = new ArrayList<PlayerItem>();
		for (PlayMember playMember : playMembers) {
			playMemberItems.add(createItem(playMember));
		}
		return playMemberItems;
	}
	
	
}
